<%@ page language="java" import="java.util.*,com.flylee.util.CutImagUtil" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>

<%
 	String realPath = request.getRealPath("/");  //获取图片服务器绝对路径
 	String imagePath  = request.getParameter("imagepath");
 	//裁剪以后保存小图片 路径
 	String fileName= new Date().getTime()+".jpg";
 	String targetPath = realPath  +"/images/"+fileName;
 	
 	//裁剪图片地址
 	String srcPath = realPath+imagePath;
 	String x = request.getParameter("x");
 	String y = request.getParameter("y");
 	String w = request.getParameter("w");
 	String h = request.getParameter("h");
 	CutImagUtil.cutImage(srcPath, targetPath, Integer.parseInt(x), Integer.parseInt(y),
 			Integer.parseInt(w), Integer.parseInt(h));
 	out.println("<img src='images/"+fileName+"'/>");
%>
